//
//  BSZTabBar.m
//  BuSuanZi
//
//  Created by staff on 3/15/25.
//

#import "BSZTabBar.h"

@implementation BSZTabBar

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = WhiteColor;
//        [self setUI];
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
        
    CGFloat tabBarButtonW = self.frame.size.width / 2.0;
    CGFloat tabBarButtonIndex = 0;
    for (UIView *child in self.subviews) {

        Class class = NSClassFromString(@"UITabBarButton");
        if ([child isKindOfClass:class]) {

            // 重新设置frame
            CGRect frame = CGRectMake(tabBarButtonIndex * tabBarButtonW, 0, tabBarButtonW, 49);
            child.frame = frame;

            tabBarButtonIndex++;
        }
    }
}

@end
